#!/bin/sh
# 停止正在运行的服务
pids=$(ps -ef | grep java | grep article | awk '{print $2}')
for pid in $pids
do
  echo  kill process-$pid
  kill -9  $pid
done

# 删除原来的jar包
echo remove old jar
rm -rf /data/application/article-0.0.1-SNAPSHOT.jar

# copy新的包到部署目录
echo move new jar
mv /data/article-0.0.1-SNAPSHOT.jar /data/application

# 启动项目
echo start project
nohup java -jar -Dloader.path=.,/data/application/dependency /data/application/article-0.0.1-SNAPSHOT.jar >/dev/null 2>&1 &

